package com.jandar.task;

import java.util.TimerTask;

/**
 * 定时器任务创建工厂。
 * 
 * @author pqj
 * @version 2009-7-8
 */
public class TimeTaskFactory {

	private TimeTaskFactory() {}
	
	public static TimerTask createTimeTask(String className) {
		TimerTask task = null;
		
		try {
			Class<?> cl = Class.forName(className);
			task = (TimerTask) cl.newInstance();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		
		return task;
	}
}
